#ifndef MENUWIDGET_H
#define MENUWIDGET_H

#include <QDockWidget>
#include <QDragEnterEvent>
#include <QDebug>
#include "ResourceManger/resourceswidget.h"
#include "ResourceManger/filemanager.h"
#include <QFileInfo>
#include "gamemanager.h"
#include "Narration/narrationnode.h"
#include "menudataitem.h"
#include "GameData/gamedata.h"
#include "EditorWidgets/linkereditwidget.h"
#include "EditorWidgets/searchlineedit.h"
#include "gamemanager.h"
#include "Narration/narrationnode.h"
#include "EditorWidgets/effecteditwidget.h"
namespace Ui {
class MenuWidget;
}

class MenuWidget : public QDockWidget
{
    Q_OBJECT

public:
    explicit MenuWidget(QWidget *parent = nullptr);
    ~MenuWidget();
protected:
    virtual void dragEnterEvent(QDragEnterEvent *event);
    virtual void dropEvent(QDropEvent *event);
    void MusicDropEvent(QDropEvent* event);
private:
    Ui::MenuWidget *ui;
    void InitTabBtns();
    void InitSoundChecks();
    void InitDataBtns();
    void InitEffectUI();
    void InitData();
    void RefreshData();
    void AddDataItem(DataType t);
    void LoadcurNode();
    void LoadCurNodeSound();
    void LoadCurNodeLinkers();
    void LoadCurNodeEffect();
    void InitLinkerWidget();
    void ClearLinkers();
    //清除linkerlist
    int curDataId = 0;
    LinkerEditWidget* linkerEditWidget = nullptr;
    SearchLineEdit* searchData = nullptr;
    EffectEditWidget* effectEditWidget = nullptr;
};

#endif // MENUWIDGET_H
